<?xml version="1.0" encoding="ISO-8859-1" ?>

<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:rich="http://richfaces.org/rich"
	  xmlns:a4j="http://richfaces.org/a4j"
	  xmlns:c="http://java.sun.com/jstl/core"
	  xmlns:easy="http://easyfaces.com.br/easyfaces">
	
	<f:subview id="subviewManterCompra">

<!-- 	<script type="text/javascript">		 -->
<!-- 			function preencheDadosPopupCompra(codigo) { -->
<!-- 				document.getElementById('subviewManterCompra:formCompraManter:compra_codigo').value = codigo; -->
<!-- 			} -->
			
<!-- 		</script> -->
		
		<rich:modalPanel id="manterCompra" autosized="true" headerClass="height:20px;" resizeable="false" >
			<f:facet name="header">
				<h:outputText value="#{bundle.compra_titulo_manter}" />
			</f:facet>
			<f:facet name="controls">
				<h:panelGroup>
					<h:graphicImage value="/images/close.gif" styleClass="botao_fechar_popup" id="hideLink">
						<rich:componentControl for="manterCompra" attachTo="hideLink" operation="hide" event="onclick" />
					</h:graphicImage>
				</h:panelGroup>
			</f:facet>
			
			<div class="red">
			<rich:messages id="msgCompraManter"></rich:messages>
			</div>
			<a4j:form ajaxSubmit="true" id="formCompraManter" reRender="formCompraManter">
			
                <h:panelGrid columns="6">
<!--                 	<h:outputLabel value="#{bundle.compra_codigo}:" for="compra_codigo" /> -->
<!--                     <h:inputText id="compra_codigo" value="#{compraBackBean.compraFormBean.compraManter.codigo}" label="#{bundle.compra_codigo}" maxlength="10" size="10"  disabled="#{compraBackBean.compraFormBean.isDisabled}" /> -->
                   
<!--                    	<h:outputLabel value="#{bundle.compra_serie}:" for="compra_serie" /> -->
<!--                    	<h:inputText id="compra_serie" value="#{compraBackBean.compraFormBean.compraManter.serie}" label="#{bundle.compra_serie}" maxlength="10" size="10" disabled="#{comprBackBean.compraFormBean.isDisabled}"/> -->

	                <h:outputLabel value="#{bundle.compra_cliente_nome}*:" for="compra_cliente_nome" />
					<h:inputText id="compra_cliente_nome" label="#{bundle.compra_cliente_nome}" disabled="#{compraBackBean.compraFormBean.isDisabled}" size="30" />

					<a4j:commandButton value="#{bundle.compra_btn_popup}" id="btnPopupCliente" reRender="formCompraManter" disabled="#{compraBackBean.compraFormBean.isDisabled}" onclick="caso_de_uso_cliente = 'compra';">
					   <rich:componentControl for="popupCliente" attachTo="btnPopupCliente" operation="show" event="onclick" />
					</a4j:commandButton>  
                   
                    <h:outputLabel value="#{bundle.compra_fornecedor}*:" for="compra_fornecedor_descricao" />
					<h:inputText id="compra_fornecedor_descricao" value="#{compraBackBean.compraFormBean.compraManter.fornecedorVO.descricao}" label="#{bundle.compra_fornecedor_descricao}" disabled="#{compraBackBean.compraFormBean.isDisabled}" size="30" />

					<a4j:commandButton value="#{bundle.compra_btn_popup}" id="btnPopupFornecedor" reRender="formCompraManter" disabled="#{compraBackBean.compraFormBean.isDisabled}" onclick="caso_de_uso_fornecedor = 'compra';">
					   <rich:componentControl for="popupFornecedor" attachTo="btnPopupFornecedor" operation="show" event="onclick" />
					</a4j:commandButton>  
               
                </h:panelGrid>
                
                <h:panelGrid columns="14">
                
					<h:outputLabel value="#{bundle.compra_servico}*:" for="compra_servico_descricao" />
					<h:inputText id="compra_servico_descricao" value="#{compraBackBean.compraFormBean.compraManter.fornecedorVO.descricao}" label="#{bundle.compra_fornecedor_descricao}" disabled="#{compraBackBean.compraFormBean.isDisabled}" size="30" />

					<a4j:commandButton value="#{bundle.compra_btn_popup}" id="btnPopupServico" reRender="formCompraManter" disabled="#{compraBackBean.compraFormBean.isDisabled}" onclick="caso_de_uso_servico = 'compra';">
					   <rich:componentControl for="popupServico" attachTo="btnPopupS
					   ervico" operation="show" event="onclick" />
					</a4j:commandButton> 
                
                	<h:outputLabel value="#{bundle.compra_qtd_pessoas}:" for="compra_qtd_pessoas" />
                    <h:inputText id="compra_qtd_pessoas"  label="#{bundle.compra_qtd_pessoas}" maxlength="5" size="5"  disabled="#{compraBackBean.compraFormBean.isDisabled}" />
                
				    <h:outputLabel value="#{bundle.compra_dt_chegada}*:" for="compra_dt_chegada" />
	                <rich:calendar id="compra_dt_chegada" inputStyle="width:5em" label="#{bundle.compra_dt_chegada}" disabled="#{compraBackBean.compraFormBean.isDisabled}" datePattern="dd/MM/yyyy" />
	            
	                <h:outputLabel value="#{bundle.compra_dt_saida}*:" for="compra_dt_saida" />
	                <rich:calendar id="compra_dt_saida" inputStyle="width:5em" label="#{bundle.compra_dt_saida}" disabled="#{compraBackBean.compraFormBean.isDisabled}" datePattern="dd/MM/yyyy" />

                </h:panelGrid>
         
             
                
                <h:panelGrid columns="6">
                
                	<h:outputLabel value="#{bundle.compra_qtd}:" for="compra_qtd" />
                    <h:inputText id="compra_qtd"  label="#{bundle.compra_qtd}" maxlength="5" size="5"  disabled="#{compraBackBean.compraFormBean.isDisabled}" />
                
                	 <h:outputLabel value="#{bundle.compra_vlr_pagar}*:" for="compra_vlr_pagar" />
	                 <easy:inputCurrency id="compra_vlr_pagar" value="#{funcionarioBackBean.funcionarioFormBean.funcionarioManter.salario}" label="#{bundle.compra_vlr_pagar}" disabled="#{funcionarioBackBean.funcionarioFormBean.isDisabled}" decimalSeparator="," groupSeparator="." maxlength="8" size="8" />
	               
	               	 <h:outputLabel value="#{bundle.compra_vlr_cobrar}*:" for="compra_vlr_cobrar" />
	                 <easy:inputCurrency id="compra_vlr_cobrar" value="#{funcionarioBackBean.funcionarioFormBean.funcionarioManter.salario}" label="#{bundle.compra_vlr_cobrar}" disabled="#{funcionarioBackBean.funcionarioFormBean.isDisabled}" decimalSeparator="," groupSeparator="." maxlength="8" size="8" />
	               
                </h:panelGrid>
                
                   <div class="linha"/>
                   
                <rich:panel>
                   <f:facet name="header">
						<h:outputText value="#{bundle.fornecedor_contato}" />
					</f:facet>
							<h:panelGrid columns="4">
			              
			                    <h:outputLabel value="#{bundle.fornecedor_responsavel_nome}*:" for="fornecedor_responsavel_nome" />
			                    <h:inputText id="fornecedor_responsavel_nome" value="#{fornecedorBackBean.fornecedorFormBean.fornecedorManter.responsavelVO.nome}" label="#{bundle.fornecedor_responsavel}" disabled="#{fornecedorBackBean.fornecedorFormBean.isDisabled}" maxlength="50" size="50" />		                    
			                 
			                  	<h:outputLabel value="#{bundle.fornecedor_responsavel_email}:" for="fornecedor_responsavel_email" />
	              			    <h:inputText id="fornecedor_responsavel_email" value="#{fornecedorBackBean.fornecedorFormBean.fornecedorManter.responsavelVO.email}" label="#{bundle.fornecedor_email}" disabled="#{fornecedorBackBean.fornecedorFormBean.isDisabled}" maxlength="50" size="30" />
	              
			                    <h:outputLabel value="#{bundle.fornecedor_responsavel_telefone_celular}*:" for="fornecedor_responsavel_telefone_celular" />
			                    <easy:inputMask id="fornecedor_responsavel_telefone_celular" value="#{fornecedorBackBean.fornecedorFormBean.fornecedorManter.responsavelVO.telefoneCelular}" label="#{bundle.fornecedor_responsavel_telefone_celular}" required="false" submitWithMask="false" useMask="true" useValidate="false" useMaskSize="true"  mask="9999-9999" placeHolder="_" disabled="#{fornecedorBackBean.fornecedorFormBean.isDisabled}" />
	    
	    	                    <h:outputLabel value="#{bundle.fornecedor_responsavel_telefone_comercial}*:" for="fornecedor_responsavel_telefone_comercial" />
			                    <easy:inputMask id="fornecedor_responsavel_telefone_comercial" value="#{fornecedorBackBean.fornecedorFormBean.fornecedorManter.responsavelVO.telefoneComercial}" label="#{bundle.fornecedor_responsavel_telefone_comercial}" required="false" submitWithMask="false" useMask="true" useValidate="false" useMaskSize="true"  mask="9999-9999" placeHolder="_" disabled="#{fornecedorBackBean.fornecedorFormBean.isDisabled}" />
	                    
		            		</h:panelGrid>
               </rich:panel>
                
                <a4j:commandButton action="#{compraBackBean.manterCompra}" value="#{bundle.condicao_pagamento_btn_gravar}" id="btnGravar" reRender="formCompraConsulta, formCompraManter" disabled="#{compraBackBean.compraFormBean.isDisabled}" oncomplete="valida();" />
                <a4j:commandButton action="#{compraBackBean.excluirCompra}" value="#{bundle.condicao_pagamento_btn_excluir}" id="btnExcluir" reRender="formCompraConsulta, formCompraManter" disabled="#{!compraBackBean.compraFormBean.isDisabled}" oncomplete="valida();" />
                <a4j:commandButton value="#{bundle.condicao_pagamento_btn_voltar}" id="btnVoltar" reRender="formCompraConsulta, formCompraManter" oncomplete="valida();" />
					
			</a4j:form>

		</rich:modalPanel>
	</f:subview>

</html>